home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Performance Co-Pilot 1.3
/
SGI Performance Co-Pilot 1.3.iso
/
dist
/
dist6.4
/
pcp.idb
/
usr
/
share
/
catman
/
u_man
/
cat3
/
PMAPI
/
pmsetmode.z.z
/
pmsetmode.z
/
pmsetmode
Wrap
Text File
|
1997-04-03
|
10KB
|
199 lines
PPPPMMMMSSSSEEEETTTTMMMMOOOODDDDEEEE((((3333)))) PPPPMMMMSSSSEEEETTTTMMMMOOOODDDDEEEE((((3333))))
NNNNAAAAMMMMEEEE
ppppmmmmSSSSeeeettttMMMMooooddddeeee - set collection time parameters for the current PMAPI context
CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ppppccccpppp////ppppmmmmaaaappppiiii....hhhh>>>>
####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttiiiimmmmeeee....hhhh>>>>
iiiinnnntttt ppppmmmmSSSSeeeettttMMMMooooddddeeee((((iiiinnnntttt mmmmooooddddeeee,,,, ssssttttrrrruuuucccctttt ttttiiiimmmmeeeevvvvaaaallll ****wwwwhhhheeeennnn,,,, iiiinnnntttt ddddeeeellllttttaaaa))))
cccccccc ............ ----llllppppccccpppp
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
ppppmmmmSSSSeeeettttMMMMooooddddeeee is used to define the collection time and/or mode for accessing
performance metrics and meta-data in the current Performance Metrics
Application Programming Interface (PMAPI) context. This mode effects the
semantics of subsequent calls to the following PMAPI routines;
ppppmmmmFFFFeeeettttcccchhhh(3), ppppmmmmFFFFeeeettttcccchhhhAAAArrrrcccchhhhiiiivvvveeee(3), ppppmmmmLLLLooooooookkkkuuuuppppDDDDeeeesssscccc(3), ppppmmmmGGGGeeeettttIIIInnnnDDDDoooommmm(3),
ppppmmmmLLLLooooooookkkkuuuuppppIIIInnnnDDDDoooommmm(3) and ppppmmmmNNNNaaaammmmeeeeIIIInnnnDDDDoooommmm(3).
If _m_o_d_e is PPPPMMMM____MMMMOOOODDDDEEEE____LLLLIIIIVVVVEEEE then all information is returned from the active
pool of performance metrics, as of the time that the PMAPI call is made,
and the other two parameters to ppppmmmmSSSSeeeettttMMMMooooddddeeee are ignored. PPPPMMMM____MMMMOOOODDDDEEEE____LLLLIIIIVVVVEEEE is
the default mode when a new PMAPI context of type PPPPMMMM____CCCCOOOONNNNTTTTEEEEXXXXTTTT____HHHHOOOOSSSSTTTT is
created.
If the _m_o_d_e is not PPPPMMMM____MMMMOOOODDDDEEEE____LLLLIIIIVVVVEEEE, then the _w_h_e_n parameter defines a time
origin, and all requests for meta-data (metrics descriptions and instance
identifiers from the instance domains) will be processed to reflect the
state of the meta-data as of the time origin, i.e. we use the last state
of this information at, or before, the time origin.
If the _m_o_d_e is PPPPMMMM____MMMMOOOODDDDEEEE____IIIINNNNTTTTEEEERRRRPPPP then, in the case of ppppmmmmFFFFeeeettttcccchhhh(3), the
underlying code will use an interpolation scheme to compute the values of
the metrics from the values recorded for times in the proximity of the
time origin. A mode of PPPPMMMM____MMMMOOOODDDDEEEE____IIIINNNNTTTTEEEERRRRPPPP may be used with either an archive
context, or a host context (in the latter case the subsequent PMAPI
functions will be serviced from the primary archive log maintained by
ppppmmmmllllooooggggggggeeeerrrr(1), e.g. for VCR-replay).
If the _m_o_d_e is PPPPMMMM____MMMMOOOODDDDEEEE____FFFFOOOORRRRWWWW then, in the case of ppppmmmmFFFFeeeettttcccchhhh(3), the
collection of recorded metric values will be scanned in a forwards
direction in time, until values for at least one of the requested metrics
is located after the time origin, and then all requested metrics stored
in the log or archive at that time will be returned with the
corresponding timestamp. A _m_o_d_e of PPPPMMMM____MMMMOOOODDDDEEEE____FFFFOOOORRRRWWWW may be used with either
an archive context, or a host context (in which case the subsequent PMAPI
functions will be serviced from the primary archive log maintained by
ppppmmmmllllooooggggggggeeeerrrr(1), e.g. for VCR-replay).
If the _m_o_d_e is PPPPMMMM____MMMMOOOODDDDEEEE____BBBBAAAACCCCKKKK then, the situation is the same as for
PPPPMMMM____MMMMOOOODDDDEEEE____FFFFOOOORRRRWWWW, except a ppppmmmmFFFFeeeettttcccchhhh(3) will be serviced by scanning the
collection of recorded metrics in a backwards direction in time for
PPPPaaaaggggeeee 1111
PPPPMMMMSSSSEEEETTTTMMMMOOOODDDDEEEE((((3333)))) PPPPMMMMSSSSEEEETTTTMMMMOOOODDDDEEEE((((3333))))
metrics before the time origin.
If the mode is PPPPMMMM____MMMMOOOODDDDEEEE____FFFFOOOORRRRWWWW or PPPPMMMM____MMMMOOOODDDDEEEE____BBBBAAAACCCCKKKK, and no qualifying metrics
can be found in the requested direction of searching before the end or
start of the archive log is found, then ppppmmmmFFFFeeeettttcccchhhh(3) returns the special
error indicator, PPPPMMMM____EEEERRRRRRRR____EEEEOOOOLLLL. For modes other than PPPPMMMM____MMMMOOOODDDDEEEE____LLLLIIIIVVVVEEEE, after
each successful ppppmmmmFFFFeeeettttcccchhhh(3), the time origin is reset to the timestamp
returned via the _p_m_R_e_s_u_l_t structure from ppppmmmmFFFFeeeettttcccchhhh(3).
The ppppmmmmSSSSeeeettttMMMMooooddddeeee parameter _d_e_l_t_a defines an additional number of
milliseconds that should be used to adjust the time origin (forwards or
backwards), after the new time origin from the _p_m_R_e_s_u_l_t has been
determined. This automatic adjustment of the time origin only occurs
when the _m_o_d_e is PPPPMMMM____MMMMOOOODDDDEEEE____IIIINNNNTTTTEEEERRRRPPPP, and the adjustment is applied, even if
the ppppmmmmFFFFeeeettttcccchhhh(3) fails because the time origin is outside the range defined
by the records in an archive log, i.e. returns PPPPMMMM____EEEERRRRRRRR____EEEEOOOOLLLL.
Using these _m_o_d_e options, an application can implement replay, playback,
fast forward, reverse, etc. for performance metric values held in the
archive log by alternating calls to ppppmmmmSSSSeeeettttMMMMooooddddeeee and ppppmmmmFFFFeeeettttcccchhhh(3).
For example, the following code fragment may be used to dump just those
values recorded in an archive in correct temporal sequence, for a
selected set of performance metrics; this uses the default collection
time mechanisms.
pmNewContext(PM_CONTEXT_ARCHIVE, "myarchive");
while (pmFetchArchive(npmid, pmidlist, &result) != PM_ERR_EOL) {
/*
* process real metric values as of result->timestamp
*/
. . .
pmFreeResult(result);
}
Alternatively, to replay interpolated metrics from the log in reverse
chronological order, at 10 second intervals (of recorded time), the
following code fragment could be used.
struct timeval mytime;
mytime.tv_sec = 0x7fffffff;
pmSetMode(PM_MODE_BACK, &mytime, 0);
pmFetchArchive(&result);
mytime = result->timestamp;
pmFreeResult(result);
pmSetMode(PM_MODE_INTERP, &mytime, -10000);
while (pmFetch(numpmid, pmidlist, &result) != PM_ERR_EOL) {
/*
* process interpolated metric values as of
* result->timestamp
PPPPaaaaggggeeee 2222
PPPPMMMMSSSSEEEETTTTMMMMOOOODDDDEEEE((((3333)))) PPPPMMMMSSSSEEEETTTTMMMMOOOODDDDEEEE((((3333))))
*/
. . .
pmFreeResult(result);
}
SSSSEEEEEEEE AAAALLLLSSSSOOOO
PPPPMMMMAAAAPPPPIIII(3), ppppmmmmFFFFeeeettttcccchhhh(3), ppppmmmmFFFFeeeettttcccchhhhAAAArrrrcccchhhhiiiivvvveeee(3), ppppmmmmGGGGeeeettttIIIInnnnDDDDoooommmm(3), ppppmmmmLLLLooooooookkkkuuuuppppDDDDeeeesssscccc(3),
ppppmmmmLLLLooooooookkkkuuuuppppIIIInnnnDDDDoooommmm(3) and ppppmmmmNNNNaaaammmmeeeeIIIInnnnDDDDoooommmm(3).
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
PPPPMMMM____EEEERRRRRRRR____MMMMOOOODDDDEEEE
The _m_o_d_e parameter is invalid
PPPPaaaaggggeeee 3333